<template>
  <Card>
    <Collapse value="1">
      <Panel name="1">
        基本信息
        <p slot="content">
          <Form ref="customerInfoFormRef" :model="customerInfoForm" :rules="customerInfoFormRules" :label-width="120" inline>
            <Row>
              <Col span="12">
              <FormItem label="客户姓名" prop="">
                <Input v-model="customerInfoForm.custName" disabled></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="雇佣类型" prop="">
                <Select v-model="customerInfoForm.customerType" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectEmployTypeBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="申请编号" prop="">
                <Input v-model="customerInfoForm.loanId" disabled></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="身份证号码" prop="">
                <Input v-model="customerInfoForm.custCardNo" disabled></Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="发证机构" prop="">
                <Input v-model="customerInfoForm.custCardIssuer" disabled></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="性别" prop="">
                <Select v-model="customerInfoForm.custSex" class="task-process-detail-select" disabled>
                  <Option v-for="item in selectSexData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col>
              <FormItem label="证件有效期" prop="">
                <DatePicker v-model="customerInfoForm.custCardStartTime" :value="customerInfoForm.custCardStartTime" type="date" disabled></DatePicker>——
                <DatePicker v-model="customerInfoForm.custCardEndTime" :value="customerInfoForm.custCardEndTime" type="date" disabled></DatePicker>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="出生日期" prop="">
                <DatePicker v-model="customerInfoForm.custBirthDate" :value="customerInfoForm.custBirthDate" type="date" disabled></DatePicker>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="年龄" prop="">
                <Input v-model="customerInfoForm.custAge" disabled></Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="邮箱地址" prop="email">
                <Input v-model="customerInfoForm.email" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="婚姻状况" prop="">
                <Select v-model="customerInfoForm.maritalStatus" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectMaritalStatusBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="手机号码" prop="mobileNo">
                <Input v-model="customerInfoForm.mobileNo" :disabled="taskParams.type!=1" type="text"></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="教育程度" prop="">
                <Select v-model="customerInfoForm.eductionLevelId" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectEducationLevelBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="居住类型" prop="">
                <Select v-model="customerInfoForm.homeTypeId" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectLiveTypeBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="月租金" prop="homeMthRent">
                <Input v-model="customerInfoForm.homeMthRent" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col>
              <FormItem label="租赁时长" prop="">
                <DatePicker v-model="customerInfoForm.homeRentStartDate" :value="customerInfoForm.homeRentStartDate" type="date" :disabled="taskParams.type!=1"></DatePicker>——
                <DatePicker v-model="customerInfoForm.homeRentEndDate" :value="customerInfoForm.homeRentEndDate" type="date" :disabled="taskParams.type!=1"></DatePicker>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col>
              <FormItem label="现居地址" prop="">
                <Row>
                  <Col span="24">
                  <al-selector v-model="curHomeAry" style="width:400px;" data-type="code" level="2" :disabled="taskParams.type!=1" />
                  </Col>
                </Row>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="现居地址（路/街）" prop="">
                <Input v-model="customerInfoForm.curHomeStreet" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="现居地址（详细）" prop="">
                <Input v-model="customerInfoForm.curHomeAddress" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
            </Row>
          </Form>
        </p>
      </Panel>
    </Collapse>
    <br>
    <Collapse value="1">
      <Panel name="1">
        账户信息
        <p slot="content">
          <Form ref="customerInfoFormRef4" :model="customerInfoForm" :rules="customerInfoFormRules" :label-width="120" inline>
            <Row>
              <Col span="8">
              <FormItem label="收款账户银行" prop="receiveBankName">
                <Input :disabled="(taskParams.type!=1 || taskParams.nodeCode==='woChecking')" v-model="customerInfoForm.receiveBankName" placeholder="">
                </Input>
              </FormItem>
              </Col>
              <Col span="8">
              <FormItem label="收款账户名称" prop="receiveAcctName">
                <Input :disabled="(taskParams.type!=1 || taskParams.nodeCode==='woChecking')" v-model="customerInfoForm.receiveAcctName" placeholder="">
                </Input>
              </FormItem>
              </Col>
              <Col span="8">
              <FormItem label="收款账户卡号" prop="receiveAcctNo">
                <Input :disabled="(taskParams.type!=1 || taskParams.nodeCode==='woChecking')" v-model="customerInfoForm.receiveAcctNo" placeholder="">
                </Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="8">
              <FormItem label="还款账户银行" prop="paymentBankName">
                <Input :disabled="(taskParams.type!=1 || taskParams.nodeCode==='woChecking')" v-model="customerInfoForm.paymentBankName" placeholder="">
                </Input>
              </FormItem>
              </Col>
              <Col span="8">
              <FormItem label="还款账户名称" prop="paymentAcctName">
                <Input :disabled="(taskParams.type!=1 || taskParams.nodeCode==='woChecking')" v-model="customerInfoForm.paymentAcctName" placeholder="">
                </Input>
              </FormItem>
              </Col>
              <Col span="8">
              <FormItem label="还款账户卡号" prop="paymentAcctNo">
                <Input :disabled="(taskParams.type!=1 || taskParams.nodeCode==='woChecking')" v-model="customerInfoForm.paymentAcctNo" placeholder="">
                </Input>
              </FormItem>
              </Col>
            </Row>
          </Form>
        </p>
      </Panel>
    </Collapse>
    <br>
    <Collapse value="1" v-if="customerInfoForm.productType==13">
      <Panel name="1">
        车险信息
        <p slot="content">
          <Form :label-width="120" inline>
            <Row>
              <Col span="8">
              <FormItem label="被保险人类型" prop="insurantType">
                <Input  v-model="insurantTypeName" placeholder="">
                </Input>
              </FormItem>
              </Col>
              <Col span="8">
              <FormItem label="企业名称" prop="companyName">
                <Input  v-model="carInsuranceUser.companyName" placeholder="">
                </Input>
              </FormItem>
              </Col>

              <Col span="8">
              <FormItem label="社会统一代码" prop="companyCode">
                <Input  v-model="carInsuranceUser.companyCode" placeholder="">
                </Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="8">
              <FormItem label="实际经营地址" prop="companyAddress">
                <Input  v-model="carInsuranceUser.companyAddressTemp" placeholder="">
                </Input>
              </FormItem>
              </Col>
              <Col span="8">
              <FormItem label="法人姓名" prop="legalPersonName">
                <Input  v-model="carInsuranceUser.legalPersonName" placeholder="">
                </Input>
              </FormItem>
              </Col>
              <Col span="8">
              <FormItem label="法人身份证号" prop="legalPersonIdno">
                <Input  v-model="carInsuranceUser.legalPersonIdno" placeholder="">
                </Input>
              </FormItem>
              </Col>
              <Col span="8">
              <FormItem label="公司固话" prop="companyTel">
                <Input  v-model="carInsuranceUser.companyTel" placeholder="">
                </Input>
              </FormItem>
              </Col>

               <Col span="8">
              <FormItem label="企业签章标识" prop="companySign">
                <Input  v-model="carInsuranceInfo.companySign" placeholder="">
                </Input>
              </FormItem>
              </Col>

               <Col span="8">
              <FormItem label="车主姓名" prop="carOwnerName">
                <Input  v-model="carInsuranceInfo.carOwnerName" placeholder="">
                </Input>
              </FormItem>
              </Col>

               <Col span="8">
              <FormItem label="保险公司开户城市" prop="bxCompanyBankCity">
                <Input v-model="carInsuranceInfo.bxCompanyBankCityTemp" placeholder="">
                </Input>
              </FormItem>
              </Col>
               <Col span="8">
              <FormItem label="是否代缴交强险" prop="surrenderTaxation">
                <Input  v-model="carInsuranceInfo.surrenderTaxation" placeholder="">
                </Input>
              </FormItem>
              </Col>
            </Row>
          </Form>
        </p>
        <p slot="content">
          <Table :columns="carInsuranceInfoCols" :data="carInsuranceInfoList"></Table>
        </p>
      </Panel>
    </Collapse>
    <br>
    <Collapse value="1">
      <Panel name="1">
        工作信息
        <p slot="content">
          <Form ref="customerInfoFormRef2" :model="customerInfoForm" :rules="customerInfoFormRules" :label-width="120" inline>
            <Row>
              <Col span="12">
              <FormItem label="工作单位名称" prop="">
                <Input v-model="customerInfoForm.companyName" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="所在部门" prop="">
                <Input v-model="customerInfoForm.companyDept" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="职务名称" prop="">
                <Input v-model="customerInfoForm.companyPosition" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="公司类型" prop="">
                <Select v-model="customerInfoForm.companyTypeId" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectCompanyTypeBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="现单位工作年限" prop="">
                <Select v-model="customerInfoForm.workLength" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectWorkTimeTypeBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="月收入" prop="selfMthIncomingCde">
                <Select v-model="customerInfoForm.selfMthIncomingCde" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectIncomeTypeBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col>
              <FormItem label="公司电话" prop="">
                <FormItem label="" prop="companyCode">
                  <Input v-model="customerInfoForm.companyCode" :disabled="taskParams.type!=1"></Input>
                </FormItem>
                <FormItem label="" prop="companyTel">
                  <Input v-model="customerInfoForm.companyTel" :disabled="taskParams.type!=1"></Input>
                </FormItem>
                <FormItem label="" prop="companyExtension">
                  <Input v-model="customerInfoForm.companyExtension" :disabled="taskParams.type!=1"></Input>
                </FormItem>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col>
              <FormItem label="公司地址" prop="">
                <Row>
                  <Col span="24">
                  <al-selector v-model="curCompanyAry" data-type="code" style="width:400px;" level="2" :disabled="taskParams.type!=1" />
                  </Col>
                </Row>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="24">
              <FormItem label="公司地址（详细）" prop="">
                <Input v-model="customerInfoForm.companyAddress" :disabled="taskParams.type!=1" style="width:400px;"></Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="第二职业" prop="">
                <Select v-model="customerInfoForm.secondWorkTypeCode" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectSecondCareerBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="第三职业" prop="">
                <Select v-model="customerInfoForm.thirdWorkTypeCode" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectThridCareerBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
            </Row>
          </Form>
        </p>
      </Panel>
    </Collapse>
    <br>
    <Collapse value="1" v-if="customerInfoForm.customerType==1">
      <Panel name="1">
        自雇补充
        <p slot="content">
          <Form ref="customerInfoFormRef3" :model="customerInfoForm" :rules="customerInfoFormRules" :label-width="120" inline>
            <Row>
              <Col span="12">
              <FormItem label="法人代表" prop="">
                <Input v-model="customerInfoForm.businessLegalPerson" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="持股比例" prop="shareholdingRate">
                <Input v-model="customerInfoForm.shareholdingRate" placeholder="%" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="经营范围" prop="">
                <Input v-model="customerInfoForm.businessScope" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="人事部联系人" prop="">
                <Input v-model="customerInfoForm.personnelDeptContactor" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="公司注册时间" prop="">
                <DatePicker v-model="customerInfoForm.companyRegistrationDate" :value="customerInfoForm.companyRegistrationDate" type="date" :disabled="taskParams.type!=1"></DatePicker>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="注册资本" prop="registeredCapital">
                <Input v-model="customerInfoForm.registeredCapital" placeholder="万元" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col>
              <FormItem label="人事部联系电话" prop="">
                <FormItem label="" prop="personnelDeptContactorCode">
                  <Input v-model="customerInfoForm.personnelDeptContactorCode" :disabled="taskParams.type!=1"></Input>
                </FormItem>
                <FormItem label="" prop="personnelDeptContactorTel">
                  <Input v-model="customerInfoForm.personnelDeptContactorTel" :disabled="taskParams.type!=1"></Input>
                </FormItem>
                <FormItem label="" prop="personnelDeptContactorExtension">
                  <Input v-model="customerInfoForm.personnelDeptContactorExtension" :disabled="taskParams.type!=1"></Input>
                </FormItem>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="营业执照号码" prop="">
                <Input v-model="customerInfoForm.businessLicenseNo" :disabled="taskParams.type!=1"></Input>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="企业规模" prop="">
                <Select v-model="customerInfoForm.enterpriseScaleCode" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectEnterpriseScaleBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
            </Row>
            <Row>
              <Col span="12">
              <FormItem label="贷款投向" prop="">
                <Select v-model="customerInfoForm.loanInvestmentCode" class="task-process-detail-select" @on-change="renderInvestmentDetailList" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectLoanInvestmentBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
              <Col span="12">
              <FormItem label="投向明细" prop="">
                <Select v-model="customerInfoForm.investmentDetailCode" class="task-process-detail-select" :disabled="taskParams.type!=1">
                  <Option v-for="item in selectInvestmentDetailBasicData" :value="item.code" :key="item.code">{{ item.name }}</Option>
                </Select>
              </FormItem>
              </Col>
            </Row>
          </Form>
        </p>
      </Panel>
    </Collapse>
    <br>
    <Collapse value="1" v-if="customerInfoForm.productType==9">
      <Panel name="1">
        开心购信息
        <p slot="content">
          <Table :columns="columns4" :data="approvalOpinionDatas"></Table>
        </p>
      </Panel>
    </Collapse>
    <br>
    <Collapse value="1">
      <Panel name="1">
        联系人信息
        <p slot="content">
          <Table :columns="columns1" :data="contactData"></Table>
          <Button type="primary" icon="md-add" @click="addContactDefaultEmptyRow" v-if="taskParams.isModal==false" style="margin-top:5px;"></Button>
        </p>
      </Panel>
    </Collapse>
    <br>
    <Collapse value="1">
      <Panel name="1">
        电核录入
        <p slot="content">
          <Table :columns="columns3" :data="phoneChkData"></Table>
          <Button type="primary" icon="md-add" @click="addPhoneChkDefaultEmptyRow" v-if="taskParams.isModal==false" style="margin-top:5px;"></Button>
        </p>
      </Panel>
    </Collapse>
    <br>
    <Row>
      <div align="center" v-if="taskParams.isModal==false">
        <Button type="primary" @click="submitForm">保存</Button>
      </div>
    </Row>
    <Modal v-model="iframeState" title="录音回放"   @on-ok="ok()">
        <iframe  frameborder=0  scrolling=auto :src="softPhoneUrl"></iframe>
     </Modal>
  </Card>
</template>

<script>
import alSelector from '../../components/al-selector.vue'
import contactExpandRow from './table-contact-expand.vue'
import loanInvestmentData from './loan_investment_data.js'

export default {
  components: {
    alSelector,
    contactExpandRow
  },

  name: 'customer-info-form',
  data () {
    const validateMobile = (rule, value, callback) => {
      var myreg = /^[1][3,4,5,7,8][0-9]{9}$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的手机号码'))
      } else {
        callback()
      }
    }
    const validateHomeMthRent = (rule, value, callback) => {
      var myreg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的月租金'))
      } else {
        callback()
      }
    }
    const validateEmail = (rule, value, callback) => {
      var myreg = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的电子邮箱'))
      } else {
        callback()
      }
    }
    const validateCompanyCode = (rule, value, callback) => {
      var myreg = /^([0-9,-][0-9,-]*)$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的公司电话'))
      } else {
        callback()
      }
    }
    const validateCompanyTel = (rule, value, callback) => {
      var myreg = /^([0-9,-][0-9,-]*)$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的公司电话'))
      } else {
        callback()
      }
    }
    const validateCompanyExtension = (rule, value, callback) => {
      var myreg = /^([0-9,-][0-9,-]*)$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的公司电话'))
      } else {
        callback()
      }
    }
    const validateShareholdingRate = (rule, value, callback) => {
      var myreg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的持股比例'))
      } else {
        callback()
      }
    }
    const validatePersonnelDeptContactorCode = (rule, value, callback) => {
      var myreg = /^([0-9,-][0-9,-]*)$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的人事部联系电话'))
      } else {
        callback()
      }
    }
    const validatePersonnelDeptContactorTel = (rule, value, callback) => {
      var myreg = /^([0-9,-][0-9,-]*)$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的人事部联系电话'))
      } else {
        callback()
      }
    }
    const validatePersonnelDeptContactorExtension = (rule, value, callback) => {
      var myreg = /^([0-9,-][0-9,-]*)$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的人事部联系电话'))
      } else {
        callback()
      }
    }
    const validateRegisteredCapital = (rule, value, callback) => {
      var myreg = /^[+]{0,1}(\d+)$|^[+]{0,1}(\d+\.\d+)$/
      if (value != null && value !== '' && !myreg.test(value)) {
        callback(new Error('请输入正确的注册资本'))
      } else {
        callback()
      }
    }
    return {
      itemName: null,
      baseUrl: this.$appContext.marvels_core_approve,
      $ajax: null,
      customerInfoForm: {},
      curHomeAry: [], // 现居住地（省，市，县）
      curCompanyAry: [], // 公司住地（省，市，县
      insurantTypeName: '',
      carInsuranceUser: {}, // 车险分期
      carInsuranceInfo: {},
      carInsuranceInfoCols: [
        {
          align: 'center',
          title: '投保单号',
          key: 'insuranceNumber'
        },
        {
          align: 'center',
          title: '是否全融资',
          key: 'isAllFinancing'
        },
        {
          align: 'center',
          title: '保险公司开户行名称',
          key: 'insuranceAllCompanyBankName'
        },
        {
          align: 'center',
          title: '保险公司开户行卡号',
          key: 'insuranceCompanyBankNum'
        },
        {
          align: 'center',
          title: '被保险人姓名',
          key: 'insurantName'
        },
        {
          align: 'center',
          title: '被保险人证件号',
          key: 'insurantIdno'
        },
        {
          align: 'center',
          title: '车牌号码',
          key: 'licensePlateNo'
        },
        {
          align: 'center',
          title: '车架号',
          key: 'frameNo'
        },
        {
          align: 'center',
          title: '保险公司名',
          key: 'insuranceCompanyName'
        },
        {
          align: 'center',
          title: '交强险',
          key: 'strongInsuranceAmount'
        },
        {
          align: 'center',
          title: '商业险',
          key: 'commercialInsuranceAmount'
        }
      ],
      carInsuranceInfoList: [],
      iframeState: false,
      softPhoneUrl: null,
      columns1: [
        {
          type: 'expand',
          width: 50,
          render: (h, params) => {
            var vm = this
            return h(contactExpandRow, {
              props: {
                tempData: vm.tempContactData[params.index]
              }
            })
          }
        },
        {
          title: '序号',
          type: 'index',
          width: 60,
          align: 'center'
        },
        {
          align: 'center',
          title: '联系人姓名',
          key: 'contactName',
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                value: params.row.contactName,
                disabled: (vm.taskParams.type !== 1 || vm.taskParams.collapseCotrol === true)
              },
              on: {
                'on-change' (e) {
                  vm.initTempContactDataObject(params)
                  vm.$set(vm.tempContactData[params.index], 'contactName', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '与客户关系',
          key: 'relationCode',
          render: function (h, params) {
            const vm = this
            return h('Select', {
              props: {
                'label-in-value': true,
                disabled: (vm.taskParams.type !== 1 || vm.taskParams.collapseCotrol === true),
                value: vm.tempContactData[params.index] ? vm.tempContactData[params.index].relationCode : params.row.relationCode
              },
              on: {
                'on-change' (v) {
                  vm.initTempContactDataObject(params)
                  vm.$set(vm.tempContactData[params.index], 'relationCode', v.value)
                  vm.$set(vm.tempContactData[params.index], 'relationName', v.label)
                  for (var i in vm.selectRelationBasicData) {
                    if (vm.selectRelationBasicData[i].code === v.value) {
                      vm.$set(vm.tempContactData[params.index], 'contactType', vm.selectRelationBasicData[i].attr1)
                      break
                    }
                  }
                }
              }
            }, vm.renderRelationSelect(h, params)
            )
          }.bind(this)

        },
        {
          align: 'center',
          title: '手机号码',
          key: 'contactMobile',
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                disabled: (vm.taskParams.type !== 1 || vm.taskParams.collapseCotrol === true),
                value: params.row.contactMobile
              },
              on: {
                'on-change' (e) {
                  vm.initTempContactDataObject(params)
                  vm.$set(vm.tempContactData[params.index], 'contactMobile', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        // {
        //   align: 'center',
        //   title: '是否紧急联系人',
        //   key: 'isEmergencyContact',
        //   render: function (h, params) {
        //     const vm = this
        //     return h('Select', {
        //       props: {
        //         disabled: vm.taskParams.isModal === true,
        //         value: params.row.isEmergencyContact
        //       },
        //       on: {
        //         'on-change' (value) {
        //           vm.initTempContactDataObject(params)
        //           vm.$set(vm.tempContactData[params.index], 'isEmergencyContact', value)
        //         }
        //       }
        //     }, this.selectEmergencyContactData.map(function (item) {
        //       return h('Option', {
        //         props: {
        //           value: item.code
        //         }
        //       }, item.name)
        //     })
        //     )
        //   }.bind(this)
        // }
        {
          // align: 'center',
          title: '支付宝验证结果',
          key: 'aliPayCheckResult',
          render: function (h, params) {
            const vm = this
            return h('RadioGroup', {
              props: {
                value: vm.tempContactData[params.index].aliPayCheckResult
              },
              on: {
                'on-change' (val) {
                  vm.$set(vm.tempContactData[params.index], 'aliPayCheckResult', val)
                  if (val === '0') {
                    vm.$set(vm.tempContactData[params.index], 'aliPayCheckRemark', null)
                  }
                }
              }
            }, this.selectRadioGroup1.map(function (item) {
              return h('Radio', {
                props: {
                  disabled: (vm.taskParams.type !== 1 || vm.taskParams.collapseCotrol === true),
                  label: item.code
                }
              }, item.name)
            }))
          }.bind(this)
        },
        {
          // align: 'center',
          title: '微信验证结果',
          key: 'wechatCheckResult',
          render: function (h, params) {
            var vm = this
            return h('RadioGroup', {
              props: {
                value: vm.tempContactData[params.index].wechatCheckResult
              },
              on: {
                'on-change' (val) {
                  vm.$set(vm.tempContactData[params.index], 'wechatCheckResult', val)
                  if (val === '0') {
                    vm.$set(vm.tempContactData[params.index], 'wechatCheckRemark', null)
                  }
                }
              }
            }, this.selectRadioGroup1.map(function (item) {
              return h('Radio', {
                props: {
                  disabled: (vm.taskParams.type !== 1 || vm.taskParams.collapseCotrol === true),
                  label: item.code
                }
              }, item.name)
            }))
          }.bind(this)
        }
      ],
      columns4: [
        {
          align: 'center',
          title: '联系人姓名',
          key: 'contactName'
        },
        {
          align: 'center',
          title: '手机号码',
          key: 'contactMobile'
        },
        {
          align: 'center',
          title: '身份证号码',
          key: 'custCardNo'
        },
        {
          align: 'center',
          title: '银行卡号',
          key: 'receiveAcctNo'
        },
        {
          align: 'center',
          title: '收款卡银行账户名',
          key: 'receiveBankName'
        },
        {
          align: 'center',
          title: '申请所填公司名称',
          key: 'applyCompanyName'
        },
        {
          align: 'center',
          title: '征信报告公司名称',
          key: 'makeCompanyName'
        },
        {
          align: 'center',
          title: '征信报告职业类别',
          key: 'makeLabour'
        }
      ],
      approvalOpinionDatas: [],

      customerInfoFormRules: {
        mobileNo: [{
          validator: validateMobile,
          trigger: 'blur'
        }],
        'homeMthRent': [{
          validator: validateHomeMthRent,
          trigger: 'blur'
        }],
        'email': [{
          validator: validateEmail,
          trigger: 'blur'
        }],
        'companyCode': [{
          validator: validateCompanyCode,
          trigger: 'blur'
        }],
        'companyTel': [{
          validator: validateCompanyTel,
          trigger: 'blur'
        }],
        'companyExtension': [{
          validator: validateCompanyExtension,
          trigger: 'blur'
        }],
        'shareholdingRate': [{
          validator: validateShareholdingRate,
          trigger: 'blur'
        }],
        'personnelDeptContactorCode': [{
          validator: validatePersonnelDeptContactorCode,
          trigger: 'blur'
        }],
        'personnelDeptContactorTel': [{
          validator: validatePersonnelDeptContactorTel,
          trigger: 'blur'
        }],
        'personnelDeptContactorExtension': [{
          validator: validatePersonnelDeptContactorExtension,
          trigger: 'blur'
        }],
        'registeredCapital': [{
          validator: validateRegisteredCapital,
          trigger: 'blur'
        }],
        receiveBankName: [{
          required: true,
          message: '收款账户银行不能为空',
          trigger: 'blur'
        }],
        receiveAcctName: [{
          required: true,
          message: '收款账户名称不能为空',
          trigger: 'blur'
        }],
        receiveAcctNo: [
          {
            required: true,
            message: '收款账户卡号不能为空',
            trigger: 'blur'
          },
          {
            message: '收款账户卡号不能为非数字类型',
            trigger: 'blur',
            pattern: this.$util.regExpNum
          }],
        paymentBankName: [{
          required: true,
          message: '还款账户银行不能为空',
          trigger: 'blur'
        }],
        paymentAcctName: [{
          required: true,
          message: '还款账户名称不能为空',
          trigger: 'blur'
        }],
        paymentAcctNo: [{
          required: true,
          message: '还款账户卡号不能为空',
          trigger: 'blur'
        },
        {
          message: '还款账户卡号不能为非数字类型',
          trigger: 'blur',
          pattern: this.$util.regExpNum
        }]
      },
      contactData: [],
      tempContactData: [],
      contactEmptyRowData: {
        contactName: null,
        contactType: null,
        relationCode: null,
        relationName: null,
        contactMobile: null,
        isEmergencyContact: null,
        aliPayCheckResult: null,
        wechatCheckResult: null,
        aliPayCheckRemark: null,
        wechatCheckRemark: null,
        _expanded: true
      },
      selectSexData: [
        {
          code: 0,
          name: '女'
        },
        {
          code: 1,
          name: '男'
        }
      ],
      selectEmergencyContactData: [
        {
          code: 0,
          name: '否'
        },
        {
          code: 1,
          name: '是'
        }
      ],
      columns2: [
        {
          title: '序号',
          type: 'index',
          width: 40,
          align: 'center'
        },
        {
          align: 'center',
          title: '联系人姓名',
          key: 'contactName'
        },
        {
          align: 'center',
          title: '支付宝验证结果',
          key: 'aliPayCheckResult',
          render: function (h, params) {
            const vm = this
            return h('RadioGroup', {
              props: {
                value: vm.tempContactChkData[params.index].aliPayCheckResult
              },
              on: {
                'on-change' (val) {
                  vm.initTempContactChkDataObject(params)
                  vm.$set(vm.tempContactChkData[params.index], 'aliPayCheckResult', val)
                  if (val === '0') {
                    vm.$set(vm.tempContactChkData[params.index], 'aliPayCheckRemark', null)
                  }
                }
              }
            }, this.selectRadioGroup1.map(function (item) {
              return h('Radio', {
                props: {
                  disabled: vm.taskParams.isModal === true,
                  label: item.code
                }
              }, item.name)
            }))
          }.bind(this)
        },
        {
          align: 'center',
          title: '支付宝验证备注',
          key: 'aliPayCheckRemark',
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                value: vm.tempContactChkData[params.index].aliPayCheckRemark,
                disabled: (vm.tempContactChkData[params.index] ? vm.tempContactChkData[params.index].aliPayCheckResult === '0' : false) ||
                  vm.taskParams.isModal === true
              },
              on: {
                'on-change' (e) {
                  vm.initTempContactChkDataObject(params)
                  vm.$set(vm.tempContactChkData[params.index], 'aliPayCheckRemark', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '微信验证结果',
          key: 'wechatCheckResult',
          render: function (h, params) {
            var vm = this
            return h('RadioGroup', {
              props: {
                value: vm.tempContactChkData[params.index].wechatCheckResult
              },
              on: {
                'on-change' (val) {
                  vm.initTempContactChkDataObject(params)
                  vm.$set(vm.tempContactChkData[params.index], 'wechatCheckResult', val)
                  if (val === '0') {
                    vm.$set(vm.tempContactChkData[params.index], 'wechatCheckRemark', null)
                  }
                }
              }
            }, this.selectRadioGroup1.map(function (item) {
              return h('Radio', {
                props: {
                  disabled: vm.taskParams.isModal === true,
                  label: item.code
                }
              }, item.name)
            }))
          }.bind(this)
        },
        {
          align: 'center',
          title: '微信验证备注',
          key: 'wechatCheckRemark',
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                value: vm.tempContactChkData[params.index].wechatCheckRemark,
                disabled: (vm.tempContactChkData[params.index] ? vm.tempContactChkData[params.index].wechatCheckResult === '0' : false) ||
                  vm.taskParams.isModal === true
              },
              on: {
                'on-change' (e) {
                  vm.initTempContactChkDataObject(params)
                  vm.$set(vm.tempContactChkData[params.index], 'wechatCheckRemark', e.target.value)
                }
              }
            })
          }.bind(this)
        }
      ],
      contactChkData: [],
      tempContactChkData: [],
      contactChkEmptyRowData: {
        loanApplyContactId: null,
        contactName: null,
        aliPayCheckResult: null,
        aliPayCheckRemark: null,
        wechatCheckResult: null,
        wechatCheckRemark: null
      },
      selectRadioGroup1: [
        {
          code: '0',
          name: '一致'
        },
        {
          code: '1',
          name: '不一致'
        }
      ],
      columns3: [
        {
          align: 'center',
          title: '电话类型',
          key: 'pohneTypeCode',
          width: 100,
          render: function (h, params) {
            const vm = this
            return h('Select', {
              props: {
                value: params.row.pohneTypeCode,
                disabled: (!!params.row.id) || (vm.taskParams.type !== 1 || vm.taskParams.collapseCotrol === true)
              },
              on: {
                'on-change' (value) {
                  vm.initTempPhoneChkDataObject(params)
                  params.row.contactName = ''
                  params.row.phoneNo = ''
                  vm.$set(vm.tempPhoneChkData[params.index], 'contactName', '')
                  vm.$set(vm.tempPhoneChkData[params.index], 'phoneNo', '')
                  if (vm.contactData && vm.contactData.length > 0) {
                    for (var i in vm.contactData) {
                      if (value === vm.contactData[i].relationCode) {
                        params.row.contactName = vm.contactData[i].contactName
                        params.row.phoneNo = vm.contactData[i].contactMobile
                        vm.$set(vm.tempPhoneChkData[params.index], 'contactName', vm.contactData[i].contactName)
                        vm.$set(vm.tempPhoneChkData[params.index], 'phoneNo', vm.contactData[i].contactMobile)
                        break
                      }
                    }
                  }
                  // 如果电话号码为空、且为本人公司
                  if (vm.tempPhoneChkData[params.index].contactName === '' && value === '000') {
                    vm.$set(vm.tempPhoneChkData[params.index], 'contactName', vm.customerInfoForm.companyName)
                    params.row.contactName = vm.customerInfoForm.companyName
                  }
                  if (vm.tempPhoneChkData[params.index].phoneNo === '' && value === '000') {
                    let ccode = vm.customerInfoForm.companyCode === null ? '' : vm.customerInfoForm.companyCode
                    let ctel = vm.customerInfoForm.companyTel === null ? '' : vm.customerInfoForm.companyTel
                    let cext = vm.customerInfoForm.companyExtension === null ? '' : vm.customerInfoForm.companyExtension
                    let tPhoneNo = ccode + ctel + cext
                    vm.$set(vm.tempPhoneChkData[params.index], 'phoneNo', tPhoneNo)
                    params.row.phoneNo = tPhoneNo
                  }
                  vm.$set(vm.tempPhoneChkData[params.index], 'pohneTypeCode', value)
                }
              }
            }, this.selectRelationAllBasicData.map(function (item) {
              return h('Option', {
                props: {
                  value: item.code
                }
              }, item.name)
            })
            )
          }.bind(this)
        },
        {
          align: 'center',
          title: '联系人姓名',
          key: 'contactName',
          width: 100,
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                value: params.row.contactName,
                disabled: (!!params.row.id) || (vm.taskParams.type !== 1 || vm.taskParams.collapseCotrol === true)
              },
              on: {
                'on-change' (e) {
                  vm.initTempPhoneChkDataObject(params)
                  vm.$set(vm.tempPhoneChkData[params.index], 'contactName', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '电话号码',
          key: 'phoneNo',
          width: 100,
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'text',
                value: params.row.phoneNo,
                disabled: (!!params.row.id) || (vm.taskParams.type !== 1 || vm.taskParams.collapseCotrol === true)
              },
              on: {
                'on-change' (e) {
                  vm.initTempPhoneChkDataObject(params)
                  vm.$set(vm.tempPhoneChkData[params.index], 'phoneNo', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '电核结果',
          key: 'resultCode',
          width: 110,
          render: function (h, params) {
            const vm = this
            return h('Select', {
              props: {
                disabled: (vm.taskParams.type !== 1 || vm.taskParams.collapseCotrol === true),
                value: params.row.resultCode
              },
              on: {
                'on-change' (value) {
                  vm.initTempPhoneChkDataObject(params)
                  vm.$set(vm.tempPhoneChkData[params.index], 'resultCode', value)
                }
              }
            }, this.selectPhoneChkResultBasicData.map(function (item) {
              return h('Option', {
                props: {
                  value: item.code
                }
              }, item.name)
            })
            )
          }.bind(this)
        },
        {
          align: 'center',
          title: '电核备注',
          key: 'remark',
          width: 120,
          render: function (h, params) {
            const vm = this
            return h('Input', {
              props: {
                type: 'textarea',
                autosize: true,
                disabled: ((vm.taskParams.type + '') !== '1' || vm.taskParams.collapseCotrol === true || vm.taskParams.nodeCode !== 'woChecking'),
                value: params.row.remark
              },
              on: {
                'on-change' (e) {
                  vm.initTempPhoneChkDataObject(params)
                  vm.$set(vm.tempPhoneChkData[params.index], 'remark', e.target.value)
                }
              }
            })
          }.bind(this)
        },
        {
          align: 'center',
          title: '操作人',
          key: 'createdBy',
          width: 80
        },
        {
          align: 'center',
          title: '创建时间',
          key: 'createdDate',
          width: 100,
          render: (h, params) => {
            var vm = this
            return h('span', {}, vm.$util.formatTime(params.row.createdDate))
          }
        },
        {
          align: 'center',
          title: '电核时间',
          key: 'startTime',
          width: 100
        },
        {
          align: 'center',
          title: '通话时间',
          key: 'duration',
          width: 100
        },
        {
          align: 'center',
          title: '操作',
          width: 160,
          key: 'action',
          render: (h, params) => {
            var vm = this
            if (params.row.id && !params.row.uniqueid && vm.taskParams.nodeCode === 'woChecking') {
              return h('div', [
                h('Button', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      vm.dial(params)
                    }
                  }
                }, ' 拨号'),
                h('Button', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      vm.savePhoneChkInfo(params.index, params.row.id)
                    }
                  }
                }, '保存')
              ])
            }
            if (params.row.uniqueid && params.row.uniqueid != null && params.row.uniqueid !== '' && vm.taskParams.nodeCode === 'woChecking') {
              return h('div', {}, [
                h('Button', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      vm.dial(params)
                    }
                  }
                }, ' 拨号'),
                h('Button', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      vm.recordPlayback(params.row)
                    }
                  }
                }, '录音'),
                h('Button', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      vm.savePhoneChkInfo(params.index, params.row.id)
                    }
                  }
                }, '保存')
              ])
            }
            if (!params.row.id) {
              return h('div', [
                h('Button', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      vm.savePhoneChkInfo(params.index, params.row.id)
                    }
                  }
                }, '保存')

              ])
            } else {
              return h('div', [
                h('Button', {
                  props: {
                    type: 'primary',
                    size: 'small'
                  },
                  on: {
                    click: () => {
                      vm.recordPlayback(params.row)
                    }
                  }
                }, '录音')
              ])
            }
          }
        }
      ],
      phoneChkData: [],
      tempPhoneChkData: [],
      phoneChkEmptyRowData: {
        pohneTypeCode: null,
        contactName: null,
        phoneNo: null,
        resultCode: null,
        remark: null,
        updatedBy: null,
        createdDate: null,
        startTime: null,
        duration: null
      },
      selectEmployTypeBasicData: [],
      selectMaritalStatusBasicData: [],
      selectEducationLevelBasicData: [],
      selectLiveTypeBasicData: [],
      selectProvinceBasicData: [],
      selectCityBasicData: [],
      selectRegionBasicData: [],
      selectCompanyTypeBasicData: [],
      selectWorkTimeTypeBasicData: [],
      selectIncomeTypeBasicData: [],
      selectRelationBasicData: [],
      // selectRelationOtherBasicData:[],
      selectRelationAllBasicData: [],
      selectPhoneChkResultBasicData: [],
      selectSecondCareerBasicData: [],
      selectThridCareerBasicData: [],
      selectEnterpriseScaleBasicData: [],
      selectLoanInvestmentBasicData: [],
      selectInvestmentDetailBasicData: []
    }
  },
  methods: {
    initpage () {
      this.initSelectData()
    },
    // 初始化下拉列表数据
    initSelectData () {
      var vm = this
      this.$ajax.post(this.baseUrl + 'approve/process/task_process/service/getCustomerBasicDatas').then(re => {
        var data = re.data
        var code = data.code
        var message = data.message
        if (code !== 'success') {
          this.$Message.warning(message)
          return
        }
        vm.selectEmployTypeBasicData = data.data.employTypeBasicData
        vm.selectMaritalStatusBasicData = data.data.maritalStatusBasicData
        vm.selectEducationLevelBasicData = data.data.educationLevelBasicData
        vm.selectLiveTypeBasicData = data.data.liveTypeBasicData
        vm.selectProvinceBasicData = data.data.provinceBasicData
        vm.selectCityBasicData = data.data.cityBasicData
        vm.selectRegionBasicData = data.data.regionBasicData
        vm.selectCompanyTypeBasicData = data.data.companyTypeBasicData
        vm.selectWorkTimeTypeBasicData = data.data.workTimeTypeBasicData
        vm.selectIncomeTypeBasicData = data.data.incomeTypeBasicData
        vm.selectRelationBasicData = data.data.relationBasicData
        // vm.selectRelationOtherBasicData = data.data.relationOtherBasicData;
        // if(vm.selectRelationBasicData && vm.selectRelationOtherBasicData){
        //     vm.selectRelationAllBasicData = vm.selectRelationBasicData.concat(vm.selectRelationOtherBasicData);
        // }
        vm.selectRelationAllBasicData = data.data.relationBasicData
        vm.selectPhoneChkResultBasicData = data.data.phoneChkResultBasicData
        vm.selectSecondCareerBasicData = data.data.twoCareerTypeBasicData
        vm.selectThridCareerBasicData = data.data.threeCareerTypeBasicData
        vm.selectEnterpriseScaleBasicData = data.data.enterpriseScaleTypeBasicData
        vm.initFormData()
      }).catch(er => {

      })
    },
    // 初始化表单数据
    initFormData () {
      var vm = this
      var url = this.baseUrl + 'approve/process/task_process/service/getCustomerDetail/' + this.taskParams.curLoanId
      this.$ajax.get(url).then(re => {
        var data = re.data
        var code = data.code
        var message = data.message
        if (code !== 'success') {
          this.$Message.warning(message)
          return
        }
        vm.customerInfoForm = data.data
        vm.customerInfoForm.customerType = '' + vm.customerInfoForm.customerType
        vm.customerInfoForm.eductionLevelId = '' + vm.customerInfoForm.eductionLevelId
        vm.customerInfoForm.custCardStartTime = vm.customerInfoForm.custCardStartTime ? new Date(vm.customerInfoForm.custCardStartTime) : ''
        vm.customerInfoForm.custCardEndTime = vm.customerInfoForm.custCardEndTime ? new Date(vm.customerInfoForm.custCardEndTime) : ''
        vm.customerInfoForm.custBirthDate = vm.customerInfoForm.custBirthDate ? new Date(vm.customerInfoForm.custBirthDate) : ''
        vm.customerInfoForm.homeRentStartDate = vm.customerInfoForm.homeRentStartDate ? new Date(vm.customerInfoForm.homeRentStartDate) : ''
        vm.customerInfoForm.homeRentEndDate = vm.customerInfoForm.homeRentEndDate ? new Date(vm.customerInfoForm.homeRentEndDate) : ''
        vm.customerInfoForm.companyRegistrationDate = vm.customerInfoForm.companyRegistrationDate ? new Date(vm.customerInfoForm.companyRegistrationDate) : ''
        vm.renderInvestmentDetailList(vm.customerInfoForm.loanInvestmentCode)

        vm.curHomeAry = [vm.customerInfoForm.curHomeProvince, vm.customerInfoForm.curHomeCity, vm.customerInfoForm.curHomeCounty]
        vm.curCompanyAry = [vm.customerInfoForm.companyProvince, vm.customerInfoForm.companyCity, vm.customerInfoForm.companyCounty]

        vm.contactData = data.data.contacts
        vm.loadContactData()
        // vm.contactChkData = data.data.contactChks
        // vm.loadContactChkData()

        // vm.kxgData = data.data.kxgChks
        // vm.loadkxgData()

        vm.phoneChkData = data.data.phoneChks
        vm.loadPhoneChkData()
        vm.initApprovalLogDatas(data.data.feelChks)

        vm.findCar(data.data)
      }).catch(er => {

      })
    },
    findCar (data) {
      if (data.carInsuranceInfo === null || data.carInsuranceUser === null) {
        return
      }
      if (data.carInsuranceInfo.insurantType === '0') {
        this.insurantTypeName = '企业'
      } else {
        this.insurantTypeName = '个人'
      }
      this.carInsuranceInfo = data.carInsuranceInfo

      this.carInsuranceUser = data.carInsuranceInfo.carInsuranceUser
      this.carInsuranceUser.companyAddressTemp = this.carInsuranceUser.companyProvinceName + this.carInsuranceUser.companyCityName + this.carInsuranceUser.companyAreaName + this.carInsuranceUser.companyAddress
      this.carInsuranceInfo.bxCompanyBankCityTemp = this.carInsuranceInfo.bxCompanyBankProvince + this.carInsuranceInfo.bxCompanyBankCity
      this.carInsuranceInfoList = data.carInsuranceInfo.carList === null ? [] : data.carInsuranceInfo.carList
      let carLength = this.carInsuranceInfoList.length

      for (let i = 0; i < carLength; i++) {
        let oneCarInfo = this.carInsuranceInfoList[i]
        oneCarInfo.insuranceNumber = data.carInsuranceInfo.insuranceNumber
        // 0全融资1非全融资
        oneCarInfo.isAllFinancing = data.carInsuranceInfo.isAllFinancing === '0' ? '是' : '否'
        oneCarInfo.insuranceAllCompanyBankName = data.carInsuranceInfo.insuranceCompanyMainBankName + ' - ' + data.carInsuranceInfo.insuranceCompanyBankName

        oneCarInfo.insuranceCompanyBankNum = data.carInsuranceInfo.insuranceCompanyBankNum
        oneCarInfo.insurantName = data.carInsuranceInfo.insurantName
        oneCarInfo.insurantIdno = data.carInsuranceInfo.insurantIdno
        oneCarInfo.insurantIdno = data.carInsuranceInfo.insurantIdno
        oneCarInfo.insuranceCompanyName = data.carInsuranceInfo.insuranceCompanyName
      }
    },
    initApprovalLogDatas (opinions) {
      this.approvalOpinionDatas = opinions
      // approvalLogDatas
      // opinions.forEach(item => {
      //   item.endTimeForMat = this.$util.formatTime(new Date(item.updatedDate))
      //   this.approvalOpinionDatas.push(item)
      // })
    },
    // 初始化联系人数组数据对象
    initTempContactDataObject (params) {
      if (!this.tempContactData[params.index]) {
        this.tempContactData[params.index] = {}
      }
    },
    // 添加联系人行
    addContactDefaultEmptyRow () {
      this.contactData = this.$util.cloneObject(this.tempContactData)
      this.contactData.push(this.$util.cloneObject(this.contactEmptyRowData))
      this.tempContactData.push(this.$util.cloneObject(this.contactEmptyRowData))
      // this.contactChkData = this.$util.cloneObject(this.tempContactChkData);
      // this.contactChkData.push(this.$util.cloneObject(this.contactChkEmptyRowData));
      // this.tempContactChkData = this.$util.cloneObject(this.contactChkData);
    },
    // 添加联系人行时，动态渲染客户关系列表
    renderRelationSelect (h, params) {
      const vm = this
      // if(params.row.contactType === 0){
      return vm.selectRelationBasicData.map(function (item) {
        return h('Option', {
          props: {
            value: item.code
          }
        }, item.name)
      })
      // }else if(params.row.contactType === 1){
      //     return vm.selectRelationOtherBasicData.map(function(item){
      //         return h('Option',{
      //             props:{
      //                 value:item.code
      //             }
      //         },item.name);
      //     })
      // }else{
      //     return vm.selectRelationAllBasicData.map(function(item){
      //         return h('Option',{
      //             props:{
      //                 value:item.code
      //             }
      //         },item.name);
      //     })
      // }
    },
    // 初始化联系人验证结果数组数据对象
    initTempContactChkDataObject (params) {
      if (!this.tempContactChkData[params.index]) {
        this.tempContactChkData[params.index] = {}
      }
    },
    // 初始化电核录入数组数据对象
    initTempPhoneChkDataObject (params) {
      if (!this.tempPhoneChkData[params.index]) {
        this.tempPhoneChkData[params.index] = {}
      }
    },
    addPhoneChkDefaultEmptyRow () {
      this.phoneChkData = this.$util.cloneObject(this.tempPhoneChkData)
      this.phoneChkData.push(this.$util.cloneObject(this.phoneChkEmptyRowData))
    },
    // 加载联系人信息表格数据
    loadContactData () {
      if (this.contactData && this.contactData.length > 0) {
        this.tempContactData = this.$util.cloneObject(this.contactData)
      }
    },
    // 加载联系人验证结果表格数据
    loadContactChkData () {
      // 默认添加一个'本人'验证行记录
      var row = this.$util.cloneObject(this.contactChkEmptyRowData)
      row.contactName = '本人'
      row.loanApplyContactId = -1
      var hasSelf = false
      if (this.contactChkData && this.contactChkData.length > 0) {
        for (var i in this.contactChkData) {
          if (this.contactChkData[i].loanApplyContactId === -1) {
            hasSelf = true
            break
          }
        }
      }
      if (!hasSelf) {
        this.contactChkData.unshift(row)
      }
      this.tempContactChkData = this.$util.cloneObject(this.contactChkData)
    },
    // 加载电核录入表格数据
    loadPhoneChkData () {
      if (this.phoneChkData && this.phoneChkData.length > 0) {
        this.tempPhoneChkData = this.$util.cloneObject(this.phoneChkData)
      }
    },
    submitForm () {
      var vm = this
      this.$refs.customerInfoFormRef.validate(valid => {
        if (valid) {
          for (let i = 0; i < vm.tempContactData.length; i++) {
            let c = vm.tempContactData[i]
            if (c.aliPayCheckResult == null || c.wechatCheckResult == null) {
              vm.$Message.warning('请填写联系人验证结果')
              return
            }
            if ((c.aliPayCheckResult === '1' && (c.aliPayCheckRemark === null || c.aliPayCheckRemark === '')) ||
              (c.wechatCheckResult === '1' && (c.wechatCheckRemark === null || c.wechatCheckRemark === ''))) {
              vm.$Message.warning('联系人验证结果不一致的请填写备注')
              return
            }
          }
          // 将临时表格数据复制给表单
          vm.contactData = vm.$util.cloneObject(vm.tempContactData)
          // this.contactChkData = this.$util.cloneObject(this.tempContactChkData)
          vm.phoneChkData = vm.$util.cloneObject(vm.tempPhoneChkData)
          vm.customerInfoForm.contacts = vm.contactData
          // this.customerInfoForm.contactChks = this.contactChkData
          vm.customerInfoForm.phoneChks = vm.phoneChkData

          // 城市级联赋值
          vm.customerInfoForm.curHomeProvince = vm.curHomeAry[0]
          vm.customerInfoForm.curHomeCity = vm.curHomeAry[1]
          vm.customerInfoForm.curHomeCounty = vm.curHomeAry[2]
          vm.customerInfoForm.companyProvince = vm.curCompanyAry[0]
          vm.customerInfoForm.companyCity = vm.curCompanyAry[1]
          vm.customerInfoForm.companyCounty = vm.curCompanyAry[2]

          var params = vm.customerInfoForm
          vm.$ajax.post(vm.baseUrl + 'approve/process/task_process/service/saveCustomerInfo', params).then(re => {
            var data = re.data
            var code = data.code
            var message = data.message
            if (code !== 'success') {
              vm.$Message.warning(message)
              return
            }
            vm.$Message.success(message)
            vm.contactData = data.data.contacts
            vm.loadContactData()
            // vm.contactChkData = data.data.contactChks
            // vm.loadContactChkData()

            vm.kxgData = data.data.kxgChks
            vm.loadkxgData()

            vm.phoneChkData = data.data.phoneChks
            vm.loadPhoneChkData()
          }).catch(er => {

          })
        } else {
          this.$Message.warning('表单数据不合规，请检查')
        }
      })
    },
    // 拨号
    dial (params) {
      var vm = this
      this.$ajax.post(this.baseUrl + 'approve/process/task_process/service/getLoginUserInfo').then(re => {
        var data = re.data
        var code = data.code
        var message = data.message
        if (code !== 'success') {
          this.$Message.warning(message)
          return
        }
        var shortPhoneNo = data.data.shortPhoneNo
        var phoneZoneNo = data.data.phoneZoneNo
        if (shortPhoneNo && shortPhoneNo !== '') {
          var index = vm.baseUrl.indexOf('http://')
          var backUrl = null
          if (index >= 0) {
            backUrl = vm.baseUrl.substring(7, vm.baseUrl.length) + 'approve/process/task_process/service/writeCallInfo/' + params.row.id
          } else {
            backUrl = vm.baseUrl + 'approve/process/task_process/service/writeCallInfo/' + params.row.id
          }
          // var backUrl = '10.0.11.151:9300/approve/process/task_process/service/writeCallInfo/' + params.row.id
          $.ajax({
            url: 'http://10.0.17.200:9800/SmartWS.php',
            data: {
              'Act': 'Call_Originate',
              'Ext': shortPhoneNo,
              'Dest': params.row.phoneNo,
              'Area': phoneZoneNo,
              // 回写地址
              'Writeback': backUrl
            },
            dataType: 'jsonp',
            jsonp: 'jsonpCallback',
            jsonpCallback: 'SmartWS',
            success: function (retData, textStatus, jqXHR) {
              if (retData.retinfo === 'SUCCESS') {
                vm.$Message.success('已成功拨通对方号码，请拿起话机')
              } else {
                vm.$Message.warning('未拨通')
              }
            }
          })
        } else {
          this.$Message.warning('您没有注册短号')
        }
      }).catch(er => {

      })
    },
    // 录音回放
    recordPlayback (row) {
      if (row.uniqueid != null && row.uniqueid !== '') {
        var url = 'http://10.0.17.200:9800/SmartWS.php?Act=Recording&Uniqueid=' + row.uniqueid + '&Type=Playback'
        this.iframeState = true
        this.softPhoneUrl = url
      }
    },
    ok () {
      this.iframeState = false
    },
    // 保存电核录入记录
    savePhoneChkInfo (index, id) {
      var pohneTypeCode = this.tempPhoneChkData[index].pohneTypeCode
      var contactName = this.tempPhoneChkData[index].contactName
      var phoneNo = this.tempPhoneChkData[index].phoneNo
      var resultCode = this.tempPhoneChkData[index].resultCode
      var remark = this.tempPhoneChkData[index].remark
      if (!pohneTypeCode || !contactName || !phoneNo) {
        this.$Message.warning('电话类型，联系人姓名，电话号码不能为空')
        return
      }
      var vm = this
      var params = { pohneTypeCode: pohneTypeCode, contactName: contactName, phoneNo: phoneNo, loanId: this.taskParams.curLoanId, resultCode: resultCode, remark: remark, id: id }
      this.$ajax.post(this.baseUrl + 'approve/process/task_process/service/savePhoneChkInfo', params).then(re => {
        var data = re.data
        var code = data.code
        var message = data.message
        if (code !== 'success') {
          this.$Message.warning(message)
          return
        }
        this.$Message.success(message)
        vm.tempPhoneChkData[index] = data.data
        vm.phoneChkData = this.$util.cloneObject(vm.tempPhoneChkData)
      }).catch(er => {

      })
    },
    renderInvestmentDetailList (val) {
      this.selectInvestmentDetailBasicData = loanInvestmentData.loanInvestmentChildrenData[val]
    }
  },
  computed: {

  },
  mounted () {
    this.selectLoanInvestmentBasicData = loanInvestmentData.loanInvestmentParentData
  },
  created () {
    this.$ajax = this.$util.ajax()
    if (this.taskParams.isLoad) {
      this.initpage()
    }
  },
  watch: {
    // 点击tab页签，加载数据，只加载一次
    'taskParams.customerInfo' (v) {
      if (v) {
        this.initpage()
      }
    }
  },
  props: {
    taskParams: Object
  }
}
</script>
<style lang="less" scoped>
.ivu-col.ivu-col-span-12 {
  height: 40px;
}
.ivu-col{
  height: 40px;
}
</style>
